The functions and commands included in this external package can be grouped into six sets. These are:
• Speech Channels
• Channels Information
• Quick Speak
• General Settings
• General Information
• Compatibility
Inside the Design Environment of 4D you will see these names also as the titles of the pop-up menus in the lower right side with the functions in the procedure window.
Speech Channels
Below are the functions listed which allow you to open and close a speech channel and pass a string or text to it in order to have it spoken, to convert it or to control the speech:
Function Description
SP Open Voice Open a speech channel using the specified
voice.
SP Close Voice Close an opened speech channel.
SP Voice String Pass a string to a speech channel.
SP Voice Text Pass (part of) a text to a speech channel.
SP Voice code Pass a string and get the phoneme code
back.
SP Voice sound Pass a string and the sound will be stored
on disk.
SP Voice Pause Pause a voice from speaking.
SP Voice Cont Let a paused voice continue speaking.
SP Voice Stop Stop a voice from speaking.
These functions allow you greater flexibility, compared with the ”Speak Quick“ functions, but may take a lot of careful programming.
Channels Information
These are the functions to obtain and set information of a particular speech channel status and settings:
Function Description
SP Voice busy Is the speech channel still chewing on the
lines of text?
SP Voice reset Reset the values and behaviour to the
default.
SP Get Attr Get the rate and pitch of a voice.
SP Set Attr Set the rate and pitch of a voice.
Speak Quick
These functions allow you to speak a string or text without the need of opening a speech channel, but the control will not return until the Speech Manager has finished speaking:
Function Description
SP Speak String Speak a string now!
SP Speak Text Speak (part of) a text now!
These functions are easy to implement and may be sufficient for some data-bases.
General Settings
These commands enable you to obtain or set some general settings :
Function Description
SP SPEECH ON Turn speech capabilities of Speech Pack on.
SP SPEECH OFF Turn speech capabilities of Speech Pack off.
SP Features Determine which features are implemented
with this version of Speech Pack.
SP Pick Voice Present the user with a standard settings
dialog to pick a voice.
General Information
The following functions and commands allow you to obtain information about the external package, voices and the current status of the computer regarding speech:
Function Description
SP Can speak Is the Speech Manager present and the
external set up properly?
SP VERSION What is the version of the Speech Manager
and Speech Pack?
SP Count voices How many voices are installed?
SP Count open And how many voices are opened with
Speech Pack?
SP Voicename What's the name of a installed voice or
used for a speech channel?
SP VOICES ARRAY What are the names of all installed voices?
SP Voice Info What's the comment, gender and age of a
voice?
SP Language What's the language, region and script the
voice can handle?
SP Voice Type What type of synthesizer is this voice for,
its creator, id and were on disk is its data
located?
SP Speaking How many speech channels are speaking on
this computer?
SP COPYRIGHT Which version of Speeck Pack is this, and
who wrote it?
Compatibility
Any function or procedure below is to replace earlier externals which used the original MacinTalk system extension. These are included ONLY for compatibility and should not be used in any new data-base.
Function Description
Say Emulate the Say external (freeware) by
Djundi Karjadi, Natural Intelligence
Consulting, Boston, Mass.
(latest known version is 1.2, 1988)
PARLE Emulate the PARLE function from the
Macintalk RE (freeware) external package by
David Halfon, France. Only known version
published in 1992. The original external
was mailed to me by Philippe Giraud.
(BTW ”parle“ is French for ”speak“.)
SP Channel <NOT USABLE, UNDOCUMENTED>
WARNING:
Remove or rename the original ”Say“ and ”PARLE“ externals before installing Speeck Pack!
If you know of any other external which uses the original MacinTalk and you want to see it replaced, please email me at least the documentation and if possible the external itself. I will look at it and may decide to add a function to Speech Pack to replace the original external.
These functions are included for compatibility only and should not be used with any new 4D data-base. If you have replaced the original external with any of the functions listed above please inform me about it. Send an email, postcard or whatever. If I don't receive any such message the function may be removed in the future.
Because there are a lot of things outside 4D and Speech Pack which may change or have an effect on the speech, you need to check the error numbers returned thoroughly. Defensive programming is really necessary. For example, if an error is reported when using SP Open Voice, you don't need to call SP Close Voice simply because opening failed.
This is also the reason why the functions return error numbers. Just a one or zero doesn't provide enough information. You can use also the ErrorString external I have published to get the full string describing the error.
You should be prepared to handle error numbers which are not listed with each function in this manual, but may be added in the future.